<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableTranslateRecords extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('translate_records', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('translate_section_id')->comment('translate_sections表记录id');
            $table->tinyInteger('status')->default(0)->comment('是否完成：1.未审核 2.审核通过 3.审核未通过');
            $table->tinyInteger('type')->default(1)->comment('翻译类型：1.首翻 2.重译');
            $table->integer('vote_count')->default(0)->comment('点赞数量');
            $table->text('translate_text')->comment('原译文');
            $table->tinyInteger('improved_user_num')->default(0)->comment('参与改进人次');
            $table->enum('is_draft',['yes',  'no'])->default('no')->comment('是否为草稿');
            $table->timestamp('translate_time')->nullable()->comment('实际翻译时间');
            $table->string('improved_user_ids')->nullable()->comment('参与改进的用户id');
            $table->integer('improved_record_id')->comment('改进record表的记录id，作为该record的最终译文');
            $table->integer('translator_id')->comment('翻译人员id');
            $table->string('auditor', 32)->comment('审核人员');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('translate_records');
    }
}
